package com.zy.dp.bridge.example3;

public abstract class AbstractMessage
{
	protected MessageImplementor impl;

	public AbstractMessage(int type)
	{
		if (type == 1)
		{
			this.impl = new MessageSMS();
		}
		else if (type == 2)
		{
			this.impl = new MessageEmail();
		}
		else if (type == 3)
		{
			this.impl = new MessageMobile();
		}
	}

	public void sendMessage(String message, String toUser)
	{
		this.impl.send(message, toUser);
	}

}
